<!DOCTYPE html>
<html>
<head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
    <meta name="keywords" content="">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="description" content="">
    <title>RhaPHP 二哈公众号管理系统</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <link href="__STATIC__/admin/images/favicon.ico" rel="shortcut icon" type="image/x-icon" />
    {CSS href="__STATIC__/admin/css/admin_base.css" /}
    {js href='__STATIC__/jquery/jquery-1.11.0.min.js' /}
    {js href='__STATIC__/layui/layui.js' /}
    {CSS href="__STATIC__/layui/css/layui.css" /}
    {CSS href="__STATIC__/icon/icon.css" /}
    {block name="jscss"}{/block}
    <style>
        {if $setScreen ==1}
        .container_body, .wrap{width: 100%;}
        .sidebar{float:left;width: 12%;}
        .content{float: left;width: 87%;}
        .main-logo{margin-left: 5px;}
        .menu dl dt .type-ico{margin-left: 5%}
        .menu dl dd a{padding-left: 22%;}
        #addon_menu .item-icon{margin-left: 5%;}
        .addon_menu-left-nav-a .item-icon{left: 0;}
        .addon_menu-left-nav-a {padding-left: 23%;}
        {/if}
    </style>
</head>
<body class="trade-order">
<div class="topbar" id="gotop">
    <div class="wrap">
        <ul>
            <li>你好，<a class="name" href="" id="username">{$admin.admin_name}</a>
                {notempty name="miniappInfo"}
                <span class="quit">当前小程序：<a href="{:url('miniapp/index/index',['mid'=>$mpInfo['id']])}">{$miniappInfo.name}</a><i style="font-size: 9px; margin-left: 5px;">{if $miniappInfo.type==1}已认证{else/}普通{/if}</i>
                </span>
                <a class="quit" href="{:url('mp/index/miniapplists')}">切换小程序</a>
                <a href="{:url('mp/Message/messagelist')}"><i class="layui-icon">&#xe645;</i>用户消息<span class="num-feed rhaphp-msg-user show" style="display: none;">0</span></a>
                {/notempty}
                <a href="javascript:;" onclick="cacheClear()"><i class="layui-icon">&#xe640;</i>清空缓存</a>
                <a href="javascript:;" onclick="setScreen()"><i style="font-size: 14px;" class="rha-icon">&#xe879;</i>宽屏</a>
                <a class="quit" href="{:url('admin/Login/out')}"><i class="rha-icon">&#xe696;</i>退出</a>
            </li>
        </ul>
    </div>
</div>
<div class="header">
    <div class="wrap">
        <div class="logo">
            <h1 class="main-logo"><a href="{:url('mp/mp/index')}">RhaPHP</a></h1>
            <div class="sub-logo"></div>
        </div>
        <div class="nav">
            <ul>
                {volist name="t_menu" id="t"}
                <li class="{eq name="topNode" value="$t['url']"}selected{/eq}"><a href="{:url($t['url'])}">{$t.name}</a></li>
                {/volist}
            </ul>
        </div>
    </div>
</div>
<div class="container_body wrap">
    <div class="sidebar">
        <div class="menu">
            {volist name="menu" id="t"}
            <dl>
                <dt><i class="type-ico ico-trade rha-icon {eq name="t['shows']" value="1"}{/eq}">{$t.icon|raw}</i>{$t.name}</dt>
                {volist name="$t['child']" id="c"}
                <dd class="{eq name="c['shows']" value="1"}selected{/eq}"><a href="{:url($c['url'])}">{$c.name}</a></dd>
                {/volist}
            </dl>
            {/volist}
            {block name="leftMenu"}{/block}
            {if condition="isset($addonInfo.config) && !empty($addonInfo.config)"}
            <dl>
                <dt><i class="type-ico ico-trade rha-icon">&#xe617;</i>应用配置</dt></dt>
                <dd class="{eq name="$action_name" value="config"}selected{/eq}"><a href="{:url('miniapp/App/config',['name'=>$addonInfo.addon])}">基础设置</a></dd>
            </dl>
            {/if}
            <dl>
                <dt><i class="type-ico ico-trade rha-icon">&#xe670;</i>业务菜单</dt></dt>
                <div id="addon_menu" class="addon_menu-left-container">
                    <div class="addon_menu-left">
                        <ul class="addon_menu-left-nav">
                            {volist name="$addonMenu" id="v"}
                            {if isset($v.child) && is_array($v.child)}
                            <li class="addon_menu-left-nav-item addon_menu_parent {if $v.show =='1'}on{/if}">
                                <a class="addon_menu-left-nav-a" href="javascript:void(0);">
                                    <i class="item-icon type-ico ico-trade rha-icon"  width="25px" height="25px">{$v.icon|raw}</i>
                                    <span>{$v.name}</span>
                                    <span class="addon_menu-left-a-icon {if $v.show =='1'}addon_menu_down{else/}addon_menu_up{/if}"></span>
                                </a>
                                <ul class="child-item-nav" style="display: {if $v.show =='1'}block{else/}none{/if} ">
                                    {volist name="$v.child" key="k" id="c"}
                                    <li class="addon_menu-left-nav-item {eq name="$node" value="$c.url"}selected{/eq}">
                                    <a class="addon_menu-left-nav-a" href="{:url('miniapp/App/toview',['name'=>$addonInfo.addon,'node'=>$c.url])}">{$c.name}</a>
                                    </li>
                                    {/volist}
                                </ul>
                            </li>
                            {else/}
                            <li class="addon_menu-left-nav-item addon_menu_parent {eq name="$node" value="$v.url"}selected{/eq}">
                            <a class="addon_menu-left-nav-a" href="{:url('miniapp/App/toview',['name'=>$addonInfo.addon,'node'=>$v.url])}">
                                <i class="item-icon type-ico ico-trade rha-icon"  width="25px" height="25px">{$v.icon|raw}</i>
                                <span>{$v.name}</span>
                            </a>
                            </li>
                            {/if}
                            {/volist}
                        </ul>
                    </div>
                </div>
            </dl>
            <script>
                $('#addon_menu').on('click','.addon_menu-left-nav-a',function(){

                    if($(this).parents('.addon_menu-left-nav-item').hasClass('on')){
                        $(this).parents('.addon_menu-left-nav-item').removeClass('on');
                        $(this).parents('.addon_menu-left-nav-item').find('.addon_menu-left-a-icon').removeClass('addon_menu_down').addClass('addon_menu_up');
                        $(this).siblings('.child-item-nav').hide();
                    }else{
                        $('.addon_menu-left-nav-item .addon_menu-left-a-icon').removeClass('addon_menu_down').addClass('addon_menu_up');
                        $(this).parents('.addon_menu-left-nav-item').addClass('on').siblings('#addon_menu .addon_menu-left-nav-item ').removeClass('on');
                        $(this).parents('.addon_menu-left-nav-item').find('.addon_menu-left-a-icon').addClass('addon_menu_down').removeClass('addon_menu_up');
                        $('#addon_menu .addon_menu-left-nav-item .child-item-nav').hide();
                        $(this).siblings('#addon_menu .addon_menu-left-nav-item .child-item-nav').show();
                    }

                })
            </script>
        </div>
    </div>
    <div class="content" id="tradeSearchBd">
        {if condition="isset($menu_tile) OR $menu_title neq ''"}
        <div class="content-hd">
            <h2>{$menu_title}{block name="nav_title"}{/block}</h2>
        </div>
        {/if}
        {block name="body"}主内容{/block}
    </div>
</div>
<div class="footer">
    <div class="wrap">
        <!--请遵守安装使用协议，未经允许不得删除或者屏蔽有关RhaPHP字样与版权-->
        <a href="https://www.rhaphp.com" target="_blank">官方社区</a>
        <i class="vs">|</i>
        Powered By RhaPHP{$copy.version} 二哈系统 Copyright © {:date('Y')} All Rights Reserved.
    </div>
</div>
</body>
<script>
    layui.use('element', function(){
        var element = layui.element;
    });
    function getMaterial(paramName,type){
        layer.open({
            type: 2,
            title: '选择素材',
            shadeClose: true,
            shade: 0.8,
            area: ['750px', '480px'],
            content: '{:getHostDomain()}{:url("mp/Material/getMeterial","","")}/type/'+type+'/param/'+paramName //iframe的url
        });
    }
    function controllerByVal(value,paramName,type) {

        $('.form_'+paramName).attr('src',value);
        $("input[name="+paramName+"]").val(value);
    }
    // $(function () {
    //      setInterval(getMsgTotal,20000);
    //     function getMsgTotal() {
    //         $.get("{:url('mp/Message/getMsgStatusTotal')}",{},function (res) {
    //             if(res.msgTotal==0){
    //                 //TODO
    //             }else{
    //                 $('.rhaphp-msg-user').show();
    //                 $('.rhaphp-msg-user').text(res.msgTotal);
    //             }
    //
    //         })
    //     }
    // })
    var layer
    layui.use('layer', function(){
        layer = layui.layer;
    });
    function cacheClear() {
        var index =layer.load(1)
        $.post("{:url('admin/system/cacheClear')}",function (res) {
            layer.close(index);
            layer.alert(res.msg);
        })
    }
    function setScreen() {
        var index =layer.load(1)
        $.post("{:url('admin/system/setScreen')}",function (res) {
            layer.close(index);
            window.location.reload();
        })
    }
</script>
</html>